//this code is part of a tutorial to show the 
//potential to interface google apps script with
//the arduino microcontroller
//written by Kyle Brinkerhoff

var serialdoc ="0B7LTCy8EaA7pbXJkSnREYVp4RUk"; //this variable is the unique file id for the file saved in google docs.

function doGet() {   // this function is the setup function that calls the UI into existence 
var app = UiApp.createApplication();
app.add(app.loadComponent("remote"));//load the ui named "remote"
      return app;
}
//these functions write to the file that stores the command for the desktop application to download and send to the serial port
function ON(){
 DocsList.getFileById(serialdoc).replace("1");// write the command to the file to turn the 13pin on
  
}

function OFF(){
 
  var comclear=DocsList.getFileById(serialdoc).replace("0");// write the command to the file to turn the 13pin off

}

  

